Miscellaneous code for convenience