modify file hierarchy, add optimized implementation