refactored to have tip object