organizing the code