making code more concise

putting elements together and removing un-needed elements