add documentation and refactor card