make function more simple