API changes
Slight refactoring