Refactoring code into separate modules