refactor to generic object system