continue refactoring and debugging
continue refactoring and debugging