did some refactoring, but check account is still broken