refactoring the whole adaptation processes