Minor cleanup, add documentation