Cleaned up some logic to previous commit.