Change struct layout to simplify code