Some useful code.