LIB30: some code refactoring