Cleaned up code and updated core view controller