Cleaned up some implementation details.