Moved some code from the givekarma controller handle method into separate functions.