Compacted some code