code simplifcation