Simpler way of getting file extension.