Compacted some code

Used variable once more to get rid of redundant code.