Moved reading for manual gates into libs