Clean up and documentation for new functions