move notice to a function