Refactoring a little but feels like I'm missing something