Refactor code between resource and meta modules.