Optimised and removed redundant code in Recipe.java