improve calc module for UI