refactor based on TODO note