Refactor simulator to better match hardware behaviour