Updated tests. Small refactor