some refactoring && and new features