Removed more duplicated code