Add more universal functions and clean up a bit