Refactored a Keys method