little API changes, and some style changes