Re-factored Controller code and added comments.