command handler cleanup