more code cleanup on the way rewrite the expression part