Refactory to reduce 13 line of code