code refactor, some deprecation removed