Code name consistency fix and unit tests for functions