initial version
cleanup, internal fixes