refactoring
fixes suggested chrismccord