Removed dependencies on internal state (fix #2)