refactor and inline-documentation