incrementing frequency hash w/o the code smell