Code improvements. UI behaviour changes.