Refactorize stdlib