Big updating of server-side libraries + refactoring accordingly