reorganised code into folders per standard directory layout