Completely refactored library