Simplifying code finished