removed router,operation and refactored add_to_history logic