refactor code & add condition support for expression evaluation