refactor #150. not quite there