code cleanup in view models