view code cleanup