Rework lib structure