Refactor: Use partition