Refactor handle build response
Improve testing