Delete unnecessary files, move calculation from view to controller