Remove unused code and add test for value per unit