'applydirectives' moved to controller (Brett's comments incorporated)