Calculation in separate file
small refactoring