Refactored code, pragma marks