cleaned up hash handler