refactor: move expression evaluation logic to its own file