Gets rid of redundent code