removed createAttrs method and cleaned up init logic