module.php refactoring