code cleanup + layout