regex optimisations and moving voting to another module