Is this piece of code fine?