Calculation refactoring
Dialog creation extracted to a separate class
Misc