There are three functions that could be unit tested. long ones could be modularized further to enable unit testing.