refactor to support typical module