Remove unnecessary variable, make factor calculation faster
Use Math.floor instead of parseInt for better calculation