Performance boost and some utility things + clean up