Simplified some functions