Cleanup and add some docs.
Throw error so it logs to console correctly.