refactors code and removes some unneccessary files