add doc in readme, source refactor