add constants, refactor