tips are added, some refactoring