Remove crappy code, make API more consistent