Small cleanups, remove duplicate code and fix comments.