Add test, refactor getter for unittest