clean up sorting code to be more modularized, correct exporting of components file paths