make it more readable

Simplify the code