bot code re-structured + more spec