Some edits and code moving