move vote logic to module