refactored and added more constant folding rules