Updating from comments - simplifying code