starting re-write / modularization