first working version after restructuring
cleanup