Simplyfing code