refactor module constraint