Improvements to how expressions are resolved
Code refactoring