merge separate functions to stay consistent with z80 code structure