Library restructuration + simple bitmanipulation