refactor tests and mark some methods private