file restructure to clean up the code