Moved already working code to implementation, hopefully working on a
more flexible API