Placed everything inside ui.ready - which apparently gives no memory/performance-loss