login + vote rewritten