Cleanup + optmiziations