refactor render state and history
support merge action