refactor to use delegation pattern