refactoring + fixes