Parametrized and cleaned up