big fat refacto on core/controller