small fix: simplify some function