organize the code