minor refactoring for higher compiler stability