refactored into two libraries so that interfaces are separate from implementation