First phase of refactoring

Moving all UI code to it's own area
added deletion code to ui object