#1 issue solved by creating several function which check whether Tomcat service has been installed already. If positive the service will be removed and reinstalled. Check if port 8080 is in LISTEN state to avoid port conflict