Refactored out even more code.