restructure to accommodate java code too