Cleaning up implementation and docs.