improved design
support empty prefix