Make code more compact, add also type enum for slide switch element