Refactored constants and removed unused code