Simplify a piece of code
Updated project