did a tiny bit of refactoring