Condensed a bit of abandoned code