split ratio calculation method into two, extracted final calculation into method
added ratio calculation functionality