Code is broken but refactored towards module pattern