refactoring to enable zoom