simplifiy code