moved 'mode' to 'ui'. ui now lives under lib/ui