Simplify and document usage and coalesce code