Cleaned up functions brought two identical ones together