before refactoring with dicts
slight code cleanup
more refactor
more refactor