Refactor library functions
Update README