Moved some code from controller to model
Merge branch 'master' of https://github.com/Lochii/Wr1tr