Some LIB30 optimization / refactoring