minor refactoring, still working on fixing the asset issues