cleaned up business logic