Added some more utility functions and remove some superfluous imports.