Need to refactor this module.