Code clean and simplification