refactoring stdlib