code organization and tranform functions