some simplification of code