Decomposite main function