Refactor a few modules for better style