refactor defines