Refactor spec in to nested structure

Signed-off-by: Lincoln Lee <git@lincoln.hk>