Reduce amount of code