Refactoring Apply process

Adding better error handling and messages.