Add hook function functionality. Some code restyle