removing repeated code in tabs header