updates: code cleanup, unit test update