macrofied some functions