Make the code testable following the review comments