Misc. comments and refactorization