refactor by using sass function definition.