refactored to calculator and utils