refactoring objects and minor changes