Changes made as per review, unit tests added