refactor a few small things