Code cleanup, fixed build.xml and file loading