Utility headers and some useful functions