Adapted code to the newer model

Also added few views