Simplifying code