Debug refactored code. Testing on the device