refactored actionbar method