Merge dev in to refactoring