started to refactor a few things