organize and clean the code