Fixed duplicated code snippet