Refactoring modem