Rework freight_network module to prefer composition over inheritance. Rework optimization module to save code moving pieces of code to base class methods.