Code cleaning

Shorten code for efficiency