Refactored and fixed CandidateDao definition
Now more functional