simplify code
Simplify/fix code