Fixed coding style and used is_kind_of()