is casting to int in every call of this method look nice?