removed diplicated code