Add unit tests
Add guard conditional
Initialize variables on definition
Move conditional