Demo of Moving code to controller