Migrating most of ELB logic into a module