Refactored Code Organization