implementation for window factory method