Changes and refactor as per review