more refactoring (still backward compatible with hector)