add abstract fragment and refactoring