refactor seamingly done