moving data structures into separate library