cleanup, documentation and todos