refactoring + bug fixes