Simplify a bit some code