moved logic from display controller into factory