Test deploy
Application fix
Split into separate files/modules and fixed error handling.