Refactor into helper, various ui tweaks