Split the markup and output functionality