Refactor calculation code out of application
Add traits and actions
Remove outdated tests
Small template change