move new_module function to Module class