Clean up base.py by splitting the view in to different file
Fixed KeyError issues