refactoring display advertising code. see #15