modified structure for simpler compile/usage