[#1865] Kisitu/Faris | Added integration test. Refactored.
Resolving merge conflicts