Added package 'ui'
Added functionality to support both event and non-event based applications