[Enhance] Improved memory footprint

Signed-off-by: Oleg Komarov <o.komarov11@imperial.ac.uk>
[Enhance] Added NOTRAIL option

Signed-off-by: Oleg Komarov <o.komarov11@imperial.ac.uk>