more flexible hamlpy loading