internal refactoring (improving lib structure)