refactor evaluation code and constants