Refactored views and added ajax for voting