Refactor and add to readme