deleting some duplicated code