Refactor + in-code documentation