refacted partialEval as methods to reduce isinstance calls