Refactor eric_net to an OTP pattern