Minor edits,refactoring