refactorization + add color interpreter to directive