refactor AgentCommon into base AbstractAgent class