Simplified two functions.