Create separate headers and document

This keeps the same functionality, but cleans up the code.