Refactor to include it as a module