Remove repetive code