Performed major re-factor to support future dev.