some code reduction