Refactoring:added methods for asbract classes.