Fairly major overhaul introducing logic branches in separate libraries