refactor to be a little more OO