few bits cleaned up