refactor on artifact logic