refactor list example to use interface