Improve logic, code reuse and readability Add support for more corner cases Improve reporting Add definitions loading test