Simplified a little code