cleanup of backend code