CReating and moving some dojo code into dedicated controller