reogranize code