Code reordering, added Views and a Template Engine