Refactor + color handling + type checking