add readme and refactor a bit