first pass at refacotring