factored out related objects code
refactoring