adding docs, some abstraction