Splitted redundant action into a function