A few tweaks, remake of function hierarchy