Changed API a bit