restructure module. not tested!