Refactor code.
Check if keys are empty.