refactored with partial