Helper methods from Ryan's version