Minor refactor, still needs work