Simplified some functions.