Remove duplicate code :/