Fix duplicate definition
Move test code out