Code formatting; added cache option