Refine a bit, improve code documentation
Refactor to preempt writing duplicate code