Add more flexibility + unittest correction