Adam's Java Refuctoring Code