use less code to do same thing