Code cleanups, small interface improvements