code cleanup an UX improvements