fix and simplify work