fix major refactoring bugs