refactored

refactoring + small changes