more implementions and cleanups