Minor edits. Further refactor.