Simplified and consolidated more functions