Refactor to allow for easier overriding.