Consistent usage of parseInt and other minor clean up