quickstart: refactored to cleaner code