Refactored zoom source code