refractoring Store Code