some refactoring code :dancer: