Changed repeated code