API changes and slight code refactoring