was able to refactor a bit out.