Core: pack and optimize structures

Signed-off-by: Eduardo Silva <edsiper@gmail.com>