Expand and refactor tests