simplyfing code