More refactorying and review comments.