Refactor tests further and added tests for helpers