refactor: cleanup standard deviation implementation