implement more protocols, cleanup