Cleans up the implementation after feedback from @myronmarston