reduced repeated code in text views; casted values to int to avoid warnings