code and ui last minute cleanup, rebase from here