Refactor createResponse for fixing bug #21

Related to #21