Added some functions for refactoring.