refactored addStyle