Refactoring to remove eval