Code Cleanup with Functions.