Addressing CR feedback & adding unit tests