extracts common votes code to module