cleanup and separate components into files