refactoring to onject