split styling codes from main