Simplify code, avoid compiler warnings