More abstractions and bugfixes