change constants and refactoring