better check for empty keys
more, moar pythonic