Removed more repeated code