Refactor deploy script into discrete functions for clarity and easier maintenance.
Ignore idea dir