corrections and code cleanup in models/views