refactored dictionary into its own class