Bit of cleanup
Move raw to utils
Use resource instead of SQL constructor