restructuring of module functions