Moved to_dictionary to BaseHandler class