Better solution to #16