Small refactoring, still figuring out this functional stuff