refactor wmf module