refactored with object properties