cleaned module function