Modified to be a bit more clean.