Refactor, better loading of initial resources.