Refactoring several files and fixing some minor bugs