Selfoptimized Superconductivity Attainable By Interlayer Phase