major overhaul
renamed core to lib