Many cleanups and allow OOP style usage