Some more refactoring
Some more refactoring
Update to work with new signature