onclick and refinements to loading