little simplification of code