update readme and refactor a bit