Refactor, document, and finalize prototype