Switched using here documents for better code readability
Thanks to @thatJavaNerd